package com.trace.wells.charactertracker;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class ConstantSpellHelper {

	/**
	 * Receives an array containing numbers representing the space the character
	 * has available for additional spells.
	 * 
	 * Based off that array and the class that is requesting the spells, this
	 * function concatinates all the valid spells the user can choose from and
	 * returns them in one large array.
	 * 
	 * @param listsToGet
	 * @param charClass
	 * @return
	 */

	public static String[] SPELL_SCHOOLS = new String[] { "Abjuration", "Conjuration", "Divination", "Enchantment", "Evocation", "Illusion", "Necromancy", "Transmutation", "Universal" };

	public static String[] concatinateSpellLists(int[] listsToGet, String charClass, int maxSpellLevel) {
		String[][] spellArray = { {} };

		if (charClass.equals(ConstantHelper.CLASS_BARD)) {
			spellArray = SPELL_LIST_BARD;
		} else if (charClass.equals(ConstantHelper.CLASS_CLERIC)) {
			spellArray = SPELL_LIST_CLERIC;
		} else if (charClass.equals(ConstantHelper.CLASS_DRUID)) {
			spellArray = SPELL_LIST_DRUID;
		} else if (charClass.equals(ConstantHelper.CLASS_MONK)) {
			//TODO: Monk magic type may need to be changed!!
			//spellArray = SPELL_LIST_
		} else if (charClass.equals(ConstantHelper.CLASS_PALADIN)) {
			spellArray = SPELL_LIST_PALADIN;
		} else if (charClass.equals(ConstantHelper.CLASS_RANGER)) {
			spellArray = SPELL_LIST_RANGER;
		} else if (charClass.equals(ConstantHelper.CLASS_SORCERER)) {
			spellArray = SPELL_LIST_SORCERER_WIZARD;
		} else if (charClass.equals(ConstantHelper.CLASS_WIZARD)) {
			spellArray = SPELL_LIST_SORCERER_WIZARD;
		} else
			;

		ArrayList<String> spellList = new ArrayList<String>();

		int spellCount = 0;
		for (int i = 0; i < maxSpellLevel; i++) {
			for (int j = 0; j < spellArray[i].length; j++) {
				spellList.add(spellArray[i][j]);
				spellCount++;
			}
		}

		String[] retArray = new String[spellCount];

		int retArrayCount = 0;
		for (int i = 0; i < maxSpellLevel; i++) {
			for (int j = 0; j < spellArray[i].length; j++) {
				retArray[retArrayCount] = spellArray[i][j];
				retArrayCount++;
			}
		}

		return retArray;
	}

	public static Spell getSpellData(String spellName, InputStream is, int charClass) {

		String charClassString = ConstantHelper.getClassNameAbreviation(charClass);
		boolean localBreakNeeded = false;
		Spell returnSpell = null;
		boolean needToStopReading = false;
		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
		String thisLine;
		try {
			//BufferedReader br = new BufferedReader(new FileReader(filename));

			Spell s = new Spell();
			//		thisLine = br.readLine();

			while ((thisLine = reader.readLine()) != null) { // while loop begins

				while (!thisLine.contains("+++")) {
					if (thisLine.equals(spellName)) {

						//Set the spell's name
						s.setSpellName(thisLine);
						while (!needToStopReading) {
							if (thisLine.contains("+++")) {
								needToStopReading = true;
								break;
							}
							int length = thisLine.length();
							if (length > 40) {
								length = 40;
							}
							// If this line is not the spell description...
							if (thisLine.substring(0, length).contains(":")) {
								String[] propertyArrayElement = thisLine.split("\\:");
								propertyArrayElement[0] = propertyArrayElement[0].trim();
								propertyArrayElement[1] = propertyArrayElement[1].trim();
								s.addSpellProperty(propertyArrayElement[0], propertyArrayElement[1]);

								if (propertyArrayElement[0].compareToIgnoreCase("level") == 0) {
									if (propertyArrayElement[1].contains(",")) {
										String[] classSpellLevelArray = propertyArrayElement[1].split("\\,");
										for (int i = 0; i < classSpellLevelArray.length; i++) {
											for (int j = 0; j < ConstantHelper.CLASS_NUMBER_MAX; j++) {
												if (localBreakNeeded) {
													break;
												}
												classSpellLevelArray[j] = classSpellLevelArray[j].trim();
												String[] classAndLevel = classSpellLevelArray[j].split("\\s+");
												if (classAndLevel[0].equalsIgnoreCase(charClassString)) {
													s.setSpellLevel(Integer.parseInt(classAndLevel[1]));
													localBreakNeeded = true;
													break;
												}

											}

											classSpellLevelArray[i] = classSpellLevelArray[i].trim();
											s.addClassCastingLevel(classSpellLevelArray[i]);
										}
										localBreakNeeded = false;
									} else {
										for (int j = 0; j < ConstantHelper.CLASS_NUMBER_MAX; j++) {
											String[] classAndLevel = propertyArrayElement[1].split("\\s+");
											if (classAndLevel[0].equalsIgnoreCase(charClassString)) {
												s.setSpellLevel(Integer.parseInt(classAndLevel[1]));
												break;
											}
										}
										s.addClassCastingLevel(propertyArrayElement[1]);
									}

								}
							} else {
								if (length > 15)
									length = 15;
								String isSpellSchool = isSpellSchool(thisLine.substring(0, length));
								if (isSpellSchool.length() > 0)
									s.setSpellSchool(isSpellSchool);
								s.addSpellProperty("", thisLine);
							}
							//s.addSpellProperty("", thisLine);
							if ((thisLine = reader.readLine()) == null) {
								break;
							}

						}
					}//end if
					else if ((thisLine = reader.readLine()) == null)
						break;
				}//end inner while
				returnSpell = s;
				if (needToStopReading)
					break;
			}//end outer while
		}// end try
		catch (IOException e) {
			System.err.println("Error: " + e);
		}
		return returnSpell;
	}

	public static SpellListItem getMinimumSpellData(String spellName, InputStream is, int charClass) {

		String charClassString = ConstantHelper.getClassNameAbreviation(charClass);
		SpellListItem returnSpellListItem = null;
		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
		String thisLine;
		try {
			//BufferedReader br = new BufferedReader(new FileReader(filename));

			SpellListItem sli = new SpellListItem();

			while ((thisLine = reader.readLine()) != null) { // while loop begins

				//Handle name of spell
				sli.setName(thisLine);
				
				thisLine = reader.readLine();
				int length = thisLine.length();
				if (length > 15)
					length = 15;
				String isSpellSchool = isSpellSchool(thisLine.substring(0, length));
				sli.setSchool(isSpellSchool);

				thisLine = reader.readLine();
				String[] propertyArrayElement = thisLine.split("\\:");
				//Contains "Level"
				propertyArrayElement[0] = propertyArrayElement[0].trim();

				//Contains any number of levels per class i.e. : "Sor/Wiz 6, Water 7"
				propertyArrayElement[1] = propertyArrayElement[1].trim();
				String[] classSpellLevelArray = propertyArrayElement[1].split("\\,");

				for (int i = 0; i < classSpellLevelArray.length; i++) {
					for (int j = 0; j < ConstantHelper.CLASS_NUMBER_MAX; j++) {
						String[] classAndLevel = classSpellLevelArray[i].split("\\s+");
						if (classAndLevel[0].equalsIgnoreCase(charClassString)) {
							sli.setLevel(Integer.parseInt(classAndLevel[1]));
							break;
						}
					}
				}
				sli.setCount(0);
			}

		}// end try
		catch (IOException e) {
			System.err.println("Error: " + e);
		}
		return returnSpellListItem;
	}

	public static String isSpellSchool(String data) {
		String returnString = "";
		for (String s : ConstantSpellHelper.SPELL_SCHOOLS) {
			if (data.contains(s)) {
				returnString = s;
				break;
			}
		}
		return returnString;
	}

	public static final String[][] SPELL_LIST_BARD = new String[][]

	{
			{ "Dancing Lights", "Daze", "Detect Magic", "Flare", "Ghost Sound", "Know Direction", "Light", "Lullaby", "Mage Hand", "Mending", "Message", "Open/Close", "Prestidigitation", "Read Magic", "Resistance",
					"Summon Instrument", },
			{ "Alarm", "Animate Rope", "Cause Fear", "Charm Person", "Comprehend Languages", "Confusion, Lesser", "Cure Light Wounds", "Detect Secret Doors", "Disguise Self", "Erase", "Expeditious Retreat",
					"Feather Fall", "Grease", "Hideous Laughter", "Hypnotism", "Identify", "Magic Mouth", "Magic Aura", "Obscure Object", "Remove Fear", "Silent Image", "Sleep", "Summon Monster I",
					"Undetectable Alignment", "Unseen Servant", "Ventriloquism", },
			{ "Alter Self", "Animal Messenger", "Animal Trance", "Blindness/Deafness", "Blur", "Calm Emotions", "Cat's Grace", "Cure Moderate Wounds", "Darkness", "Daze Monster", "Delay Poison", "Detect Thoughts",
					"Eagle's Splendor", "Enthrall", "Fox's Cunning", "Glitterdust", "Glossolalia", "Heroism", "Hold Person", "Hypnotic Pattern", "Invisibility", "Locate Object", "Minor Image", "Mirror Image",
					"Misdirection", "Pyrotechnics", "Rage", "Scare", "Shatter", "Silence", "Sound Burst", "Suggestion", "Summon Monster II", "Summon Swarm", "Tongues", "Whispering Wind", },
			{ "Blink", "Charm Monster", "Clairaudience/Clairvoyance", "Confusion", "Crushing Despair", "Cure Serious Wounds", "Daylight", "Deep Slumber", "Dispel Magic", "Displacement", "Fear", "Gaseous Form",
					"Geas, Lesser", "Glibness", "Good Hope", "Haste", "Illusory Script", "Invisibility Sphere", "Major Image", "Phantom Steed", "Remove Curse", "Scrying", "Sculpt Sound", "Secret Page",
					"See Invisibility", "Sepia Snake Sigil", "Slow", "Speak with Animals", "Summon Monster III", "Tiny Hut", },
			{ "Break Enchantment", "Cure Critical Wounds", "Detect Scrying", "Dimension Door", "Dominate Person", "Freedom of Movement", "Hallucinatory Terrain", "Hold Monster", "Invisibility, Greater", "Legend LoreM",
					"Locate Creature", "Modify Memory", "Neutralize Poison", "Rainbow Pattern", "Repel Vermin", "Secure Shelter", "Shadow Conjuration", "Shout", "Speak with Plants", "Summon Monster IV",
					"Zone of Silence", },
			{ "Cure Light Wounds, Mass", "Dispel Magic, Greater", "Dream", "False Vision", "Heroism, Greater", "Mind Fog", "Mirage Arcana", "Mislead", "Nightmare", "Persistent Image", "Seeming", "Shadow Evocation",
					"Shadow Walk", "Song of Discord", "Suggestion, Mass", "Summon Monster V", },
			{ "Analyze Dweomer", "Animate Objects", "Cat's Grace, Mass", "Charm Monster, Mass", "Cure Moderate Wounds, Mass", "Eagle's Splendor, Mass", "Eyebite", "Find the Path", "Fox's Cunning, Mass", "Geas/Quest",
					"Heroes' Feast", "Irresistible Dance", "Permanent Image", "Programmed Image", "Project Image", "Scrying, Greater", "Shout, Greater", "Summon Monster VI", "Sympathetic Vibration", "Veil" } };

	public static final String[][] SPELL_LIST_CLERIC = new String[][] {
			{ "Create Water", "Cure Minor Wounds", "Detect Magic", "Detect Poison", "Guidance", "Inflict Minor Wounds", "Light", "Mending", "Purify Food and Drink", "Read Magic", "Resistance", "Virtue", },
			{ "Bane", "Bless", "Bless Water", "Cause Fear", "Command", "Comprehend Languages", "Cure Light Wounds", "Curse Water", "Deathwatch", "Detect Chaos", "Detect Evil", "Detect Good", "Detect Law",
					"Detect Undead", "Divine Favor", "Doom", "Endure Elements", "Entropic Shield", "Hide from Undead", "Inflict Light Wounds", "Magic Stone", "Magic Weapon", "Obscuring Mist", "Protection from Chaos",
					"Protection from Evil", "Protection from Good", "Protection from Law", "Remove Fear", "Sanctuary", "Shield of Faith", "Summon Monster I", },
			{ "Aid", "Align Weapon", "Augury", "Bear's Endurance", "Bull's Strength", "Calm Emotions", "Consecrate", "Cure Moderate Wounds", "Darkness", "Death Knell", "Delay Poison", "Desecrate", "Eagle's Splendor",
					"Enthrall", "Find Traps", "Gentle Repose", "Hold Person", "Inflict Moderate Wounds", "Make Whole", "Owl's Wisdom", "Remove Paralysis", "Resist Energy", "Restoration, Lesser", "Shatter",
					"Shield Other", "Silence", "Sound Burst", "Spiritual Weapon", "Status", "Summon Monster II", "Undetectable Alignment", "Zone of Truth", },
			{ "Animate Dead", "Bestow Curse", "Blindness/Deafness", "Contagion", "Continual Flame", "Create Food and Water", "Cure Serious Wounds", "Daylight", "Deeper Darkness", "Dispel Magic", "Glyph of Warding",
					"Helping Hand", "Inflict Serious Wounds", "Invisibility Purge", "Locate Object", "Magic Circle against Chaos", "Magic Circle against Evil", "Magic Circle against Good", "Magic Circle against Law",
					"Magic Vestment", "Meld into Stone", "Obscure Object", "Prayer", "Protection from Energy", "Remove Blindness/Deafness", "Remove Curse", "Remove Disease", "Searing Light", "Speak with Dead",
					"Stone Shape", "Summon Monster III", "Telepathic Bond, Lesser", "Water Breathing", "Water Walk", "Wind Wall", },
			{ "Air Walk", "Control Water", "Cure Critical Wounds", "Death Ward", "Dimensional Anchor", "Discern Lies", "Dismissal", "Divination", "Divine Power", "Dweomer of Transference", "Freedom of Movement",
					"Giant Vermin", "Imbue with Spell Ability", "Inflict Critical Wounds", "Magic Weapon, Greater", "Neutralize Poison", "Planar Ally, Lesser", "Poison", "Repel Vermin", "Restoration", "Sending",
					"Spell Immunity", "Summon Monster IV", "Tongues", },
			{ "AtonementF", "Break Enchantment", "Command, Greater", "Commune", "Cure Light Wounds, Mass", "Dispel Chaos", "Dispel Evil", "Dispel Good", "Dispel Law", "Disrupting Weapon", "Flame Strike", "Hallow",
					"Inflict Light Wounds, Mass", "Insect Plague", "Mark of Justice", "Plane Shift", "Psychic Turmoil", "Raise Dead", "Righteous Might", "Scrying", "Slay Living", "Spell Resistance", "Summon Monster V",
					"Symbol of Pain", "Symbol of Sleep", "True Seeing", "Unhallow", "Wall of Stone", },
			{ "Animate Objects", "Antilife Shell", "Banishment", "Bear's Endurance, Mass", "Blade Barrier", "Bull's Strength, Mass", "Create Undead", "Cure Moderate Wounds, Mass", "Dispel Magic, Greater",
					"Eagle's Splendor, Mass", "Find the Path", "Forbiddance", "Geas/Quest", "Glyph of Warding, Greater", "Harm", "Heal", "Heroes' Feast", "Inflict Moderate Wounds, Mass", "Owl's Wisdom, Mass",
					"Planar Ally", "Summon Monster VI", "Symbol of Fear", "Symbol of Persuasion", "Undeath to Death", "Wind Walk", "Word of Recall", },
			{ "Blasphemy", "Control Weather", "Cure Serious Wounds, Mass", "Destruction", "Dictum", "Ethereal Jaunt", "Holy Word", "Inflict Serious Wounds, Mass", "Psychic Turmoil, Greater", "Refuge", "Regenerate",
					"Repulsion", "Restoration, Greater", "Resurrection", "Scrying, Greater", "Summon Monster VII", "Symbol of Stunning", "Symbol of Weakness", "Word of Chaos", },
			{ "Antimagic Field", "Brain Spider", "Cloak of Chaos", "Create Greater Undead", "Cure Critical Wounds, Mass", "Dimensional Lock", "Discern Location", "Earthquake", "Fire Storm", "Holy Aura",
					"Inflict Critical Wounds, Mass", "Planar Ally, Greater", "Shield of Law", "Spell Immunity, Greater", "Summon Monster VIII", "Symbol of Death", "Symbol of Insanity", "Unholy Aura", },
			{ "Astral Projection", "Energy Drain", "Etherealness", "Gate", "Heal, Mass", "Implosion", "Miracle", "Soul Bind", "Storm of Vengeance", "Summon Monster I", "True Resurrection" } };

	public static final String[][] SPELL_LIST_DRUID = new String[][] {
			{ "Create Water", "Cure Minor Wounds", "Detect Magic", "Detect Poison", "Flare", "Guidance", "Know Direction", "Light", "Mending", "Purify Food and Drink", "Read Magic", "Resistance", "Virtue", },
			{ "Calm Animals", "Charm Animal", "Cure Light Wounds", "Detect Animals or Plants", "Detect Snares and Pits", "Endure Elements", "Entangle", "Faerie Fire", "Goodberry", "Hide from Animals", "Jump",
					"Longstrider", "Magic Fang", "Magic Stone", "Obscuring Mist", "Pass without Trace", "Produce Flame", "Shillelagh", "Speak with Animals", "Summon Nature's Ally I", },
			{ "Animal Messenger", "Animal Trance", "Barkskin", "Bear's Endurance", "Bull's Strength", "Cat's Grace", "Chill Metal", "Delay Poison", "Fire Trap", "Flame Blade", "Flaming Sphere", "Fog Cloud",
					"Gust of Wind", "Heat Metal", "Hold Animal", "Owl's Wisdom", "Reduce Animal", "Resist Energy", "Restoration, Lesser", "Soften Earth and Stone", "Spider Climb", "Summon Nature's Ally II",
					"Summon Swarm", "Tree Shape", "Warp Wood", "Wood Shape", },
			{ "Call Lightning", "Contagion", "Cure Moderate Wounds", "Daylight", "Diminish Plants", "Dominate Animal", "Magic Fang, Greater", "Meld into Stone", "Neutralize Poison", "Plant Growth", "Poison",
					"Protection from Energy", "Quench", "Remove Disease", "Sleet Storm", "Snare", "Speak with Plants", "Spike Growth", "Stone Shape", "Summon Nature's Ally III", "Water Breathing", "Wind Wall", },
			{ "Air Walk", "Antiplant Shell", "Blight", "Command Plants", "Control Water", "Cure Serious Wounds", "Dispel Magic", "Flame Strike", "Freedom of Movement", "Giant Vermin", "Ice Storm", "Reincarnate",
					"Repel Vermin", "Rusting Grasp", "Scrying", "Spike Stones", "Summon Nature's Ally IV", },
			{ "Animal Growth", "Atonement", "Awaken", "Baleful Polymorph", "Call Lightning Storm", "Commune with Nature", "Control Winds", "Cure Critical Wounds", "Death Ward", "Hallow", "Insect Plague", "Stoneskin",
					"Summon Nature's Ally V", "Transmute Mud to Rock", "Transmute Rock to Mud", "Tree Stride", "Unhallow", "Wall of Fire", "Wall of Thorns", },
			{ "Antilife Shell", "Bear's Endurance, Mass", "Bull's Strength, Mass", "Cat's Grace, Mass", "Cure Light Wounds, Mass", "Dispel Magic, Greater", "Find the Path", "Fire Seeds", "Ironwood", "Liveoak",
					"Move Earth", "Owl's Wisdom, Mass", "Repel Wood", "Spellstaff", "Stone Tell", "Summon Nature's Ally VI", "Transport via Plants", "Wall of Stone", },
			{ "Animate Plants", "Changestaff", "Control Weather", "Creeping Doom", "Cure Moderate Wounds, Mass", "Fire Storm", "Heal", "Scrying, Greater", "Summon Nature's Ally VII", "Sunbeam",
					"Transmute Metal to Wood", "True Seeing", "Wind Walk", },
			{ "Animal Shapes", "Control Plants", "Cure Serious Wounds, Mass", "Earthquake", "Finger of Death", "Repel Metal or Stone", "Reverse Gravity", "Summon Nature's Ally VIII", "Sunburst", "Whirlwind",
					"Word of Recall", },
			{ "Antipathy", "Cure Critical Wounds, Mass", "Elemental Swarm", "Foresight", "Regenerate", "Shambler", "Shapechange", "Storm of Vengeance", "Summon Nature's Ally IX", "Sympathy" } };

	public static final String[][] SPELL_LIST_PALADIN = new String[][] {
			{ "Bless", "Bless Water", "Bless Weapon", "Create Water", "Cure Light Wounds", "Detect Poison", "Detect Undead", "Divine Favor", "Endure Elements", "Magic Weapon", "Protection from Chaos",
					"Protection from Evil", "Read Magic", "Resistance", "Restoration, Lesser", "Virtue", },
			{ "Bull's Strength", "Delay Poison", "Eagle's Splendor", "Owl's Wisdom", "Remove Paralysis", "Resist Energy", "Shield Other", "Undetectable Alignment", "Zone of Truth", },
			{ "Cure Moderate Wounds", "Daylight", "Discern Lies", "Dispel Magic", "Heal Mount", "Magic Circle against Chaos", "Magic Circle against Evil", "Magic Weapon, Greater", "Prayer", "Remove Blindness/Deafness",
					"Remove Curse", }, { "Break Enchantment", "Cure Serious Wounds", "Death Ward", "Dispel Chaos", "Dispel Evil", "Holy Sword", "Mark of Justice", "Neutralize Poison", "Restoration" } };

	public static final String[][] SPELL_LIST_RANGER = new String[][] {
			{ "Alarm", "Animal Messenger", "Calm Animals", "Charm Animal", "Delay Poison", "Detect Animals or Plants", "Detect Poison", "Detect Snares and Pits", "Endure Elements", "Entangle", "Hide from Animals",
					"Jump", "Longstrider", "Magic Fang", "Pass without Trace", "Read Magic", "Resist Energy", "Speak with Animals", "Summon Nature's Ally I", },
			{ "Barkskin", "Bear's Endurance", "Cat's Grace", "Cure Light Wounds", "Hold Animal", "Owl's Wisdom", "Protection from Energy", "Snare", "Speak with Plants", "Spike Growth", "Summon Nature's Ally II",
					"Wind Wall", },
			{ "Command Plants", "Cure Moderate Wounds", "Darkvision", "Diminish Plants", "Magic Fang, Greater", "Neutralize Poison", "Plant Growth", "Reduce Animal", "Remove Disease", "Repel Vermin",
					"Summon Nature's Ally III", "Tree Shape", "Water Walk", },
			{ "Animal Growth", "Commune with Nature", "Cure Serious Wounds", "Freedom of Movement", "Nondetection", "Summon Nature's Ally IV", "Tree Stride" } };

	public static final String[][] SPELL_LIST_SORCERER_WIZARD = new String[][] {
			{ "Resistance", "Acid Splash", "Detect Poison", "Detect Magic", "Read Magic", "Daze", "Dancing Lights", "Flare", "Light", "Ray of Frost", "Ghost Sound", "Disrupt Undead", "Touch of Fatigue", "Mage Hand",
					"Mending", "Message", "Open/Close", "Arcane Mark", "Prestidigitation", },
			{ "Alarm", "Endure Elements", "Hold Portal", "Protection from Chaos", "Protection from Evil", "Protection from Good", "Protection from Law", "Shield", "Grease", "Mage Armor", "Mount", "Obscuring Mist",
					"Summon Monster I", "Unseen Servant", "Comprehend Languages", "Detect Secret Doors", "Detect Undead", "Identify", "True Strike", "Charm Person", "Hypnotism", "Sleep", "Burning Hands",
					"Floating Disk", "Magic Missile", "Shocking Grasp", "Color Spray", "Disguise Self", "Magic Aura", "Silent Image", "Ventriloquism", "Cause Fear", "Chill Touch", "Ray of Enfeeblement", "Animate Rope",
					"Enlarge Person", "Erase", "Expeditious Retreat", "Feather Fall", "Jump", "Magic Weapon", },
			{ "Reduce Person", "Arcane Lock", "Obscure Object", "Protection from Arrows", "Resist Energy", "Acid Arrow", "Fog Cloud", "Glitterdust", "Summon Monster II", "Summon Swarm", "Web", "Detect Thoughts",
					"Locate Object", "See Invisibility", "Daze Monster", "Hideous Laughter", "Touch of Idiocy", "Continual Flame", "Darkness", "Flaming Sphere", "Gust of Wind", "Scorching Ray", "Shatter", "Blur",
					"Hypnotic Pattern", "Invisibility", "Magic Mouth", "Minor Image", "Mirror Image", "Misdirection", "Phantom Trap", "Blindness/Deafness", "Command Undead", "False Life", "Ghoul Touch", "Scare",
					"Spectral Hand", "Alter Self", "Bear's Endurance", "Bull's Strength", "Cat's Grace", "Darkvision", "Eagle's Splendor", "Fox's Cunning", "Knock", "Levitate", "Owl's Wisdom", "Pyrotechnics",
					"Rope Trick", "Spider Climb", "Whispering Wind", },
			{ "Dispel Magic", "Explosive Runes", "Magic Circle against Chaos", "Magic Circle against Evil", "Magic Circle against Good", "Magic Circle against Law", "Nondetection", "Protection from Energy",
					"Phantom Steed", "Sepia Snake Sigil", "Sleet Storm", "Stinking Cloud", "Summon Monster III", "Arcane Sight", "Clairaudience/Clairvoyance", "Telepathic Bond, Lesser", "Tongues", "Deep Slumber",
					"Heroism", "Hold Person", "Rage", "Suggestion", "Blacklight", "Daylight", "Fireball", "Lightning Bolt", "Tiny Hut", "Wind Wall", "Displacement", "Illusory Script", "Invisibility Sphere",
					"Major Image", "Gentle Repose", "Halt Undead", "Ray of Exhaustion", "Vampiric Touch", "Blink", "Flame Arrow", "Fly", "Gaseous Form", "Haste", "Keen Edge", "Magic Weapon, Greater", "Secret Page",
					"Shrink Item", "Slow", "Water Breathing", },
			{ "Dimensional Anchor", "Fire Trap", "Globe of Invulnerability, Lesser", "Remove Curse", "Stoneskin", "Black Tentacles", "Dimension Door", "Minor Creation", "Secure Shelter", "Solid Fog",
					"Summon Monster IV", "Arcane Eye", "Detect Scrying", "Locate Creature", "Scrying", "Charm Monster", "Confusion", "Crushing Despair", "Geas, Lesser", "Dweomer of Transference", "Fire Shield",
					"Ice Storm", "Resilient Sphere", "Shout", "Wall of Fire", "Wall of Ice", "Hallucinatory Terrain", "Illusory Wall", "Invisibility, Greater", "Phantasmal Killer", "Rainbow Pattern",
					"Shadow Conjuration", "Animate Dead", "Bestow Curse", "Contagion", "Enervation", "Fear", "Enlarge Person, Mass", "Mnemonic Enhancer", "Polymorph", "Reduce Person, Mass", "Stone Shape", },
			{ "Break Enchantment", "Dismissal", "Mage's Private Sanctum", "Psychic Turmoil", "Cloudkill", "Mage's Faithful Hound", "Major Creation", "Planar Binding, Lesser", "Secret Chest", "Summon Monster V",
					"Teleport", "Wall of Stone", "Contact Other Plane", "Prying Eyes", "Telepathic Bond", "Dominate Person", "Feeblemind", "Hold Monster", "Mind Fog", "Symbol of Sleep", "Cone of Cold",
					"Interposing Hand", "Sending", "Wall of Force", "Dream", "False Vision", "Mirage Arcana", "Nightmare", "Persistent Image", "Seeming", "Shadow Evocation", "Blight", "Magic Jar", "Symbol of Pain",
					"Waves of Fatigue", "Animal Growth", "Baleful Polymorph", "Fabricate", "Overland Flight", "Passwall", "Telekinesis", "Transmute Mud to Rock", "Transmute Rock to Mud", "Permanency", },
			{ "Antimagic Field", "Dispel Magic, Greater", "Globe of Invulnerability", "Guards and Wards", "Repulsion", "Acid Fog", "Planar Binding", "Summon Monster VI", "Wall of Iron", "Analyze Dweomer",
					"Legend LoreProbe Thoughts", "True Seeing", "Geas/Quest", "Heroism, Greater", "Suggestion, Mass", "Symbol of Persuasion", "Chain Lightning", "Contingency", "Forceful Hand", "Freezing Sphere",
					"Mislead", "Permanent Image", "Programmed Image", "Shadow Walk", "Veil", "Circle of Death", "Create Undead", "Eyebite", "Symbol of Fear", "Undeath to Death", "Bear's Endurance, Mass",
					"Bull's Strength, Mass", "Cat's Grace, Mass", "Control Water", "Disintegrate", "Eagle's Splendor, Mass", "Flesh to Stone", "Fox's Cunning, Mass", "Hardening", "Mage's Lucubration", "Mental Pinnacle",
					"Move Earth", "Owl's Wisdom, Mass", "Stone to Flesh", "Transformation", },
			{ "Banishment", "Psychic Turmoil, Greater", "Sequester", "Spell Turning", "Instant Summons", "Mage's Magnificent Mansion", "Phase Door", "Plane Shift", "Summon Monster VII", "Teleport, Greater",
					"Teleport Object", "Arcane Sight, Greater", "Scrying, Greater", "Vision", "Hold Person, Mass", "Insanity", "Power Word Blind", "Symbol of Stunning", "Delayed Blast Fireball", "Forcecage",
					"Grasping Hand", "Mage's Sword", "Prismatic Spray", "Invisibility, Mass", "Project Image", "Shadow Conjuration, Greater", "Simulacrum", "Control Undead", "Finger of Death", "Symbol of Weakness",
					"Waves of Exhaustion", "Control Weather", "Ethereal Jaunt", "Reverse Gravity", "Statue", "Limited Wish", },
			{ "Dimensional Lock", "Mind Blank", "Prismatic Wall", "Protection from Spells", "Incendiary Cloud", "Maze", "Planar Binding, Greater", "Summon Monster VIII", "Trap the Soul", "Discern Location",
					"Moment of Prescience", "Prying Eyes, Greater", "Antipathy", "Binding", "Charm Monster, Mass", "Demand", "Irresistible Dance", "Maddening Scream", "Power Word Stun", "Symbol of Insanity", "Sympathy",
					"Clenched Fist", "Polar Ray", "Shout, Greater", "Sunburst", "Telekinetic Sphere", "Scintillating Pattern", "Screen", "Shadow Evocation, Greater", "Clone", "Create Greater Undead", "Horrid Wilting",
					"Symbol of Death", "Iron Body", "Polymorph Any Object", "Temporal Stasis", },
			{ "Freedom", "Imprisonment", "Mage's Disjunction", "Prismatic Sphere", "Gate", "Refuge", "Summon Monster I", "Teleportation Circle", "Foresight", "Dominate Monster", "Hold Monster, Mass", "Power Word Kill",
					"Crushing Hand", "Meteor Swarm", "Shades", "Weird", "Astral Projection", "Energy Drain", "Soul Bind", "Wail of the Banshee", "Etherealness", "Shapechange", "Time Stop", "Wish" } };
}